package org.example.utils;

import java.io.File;

/**
 * Utility class for operating system related tasks.
 */
public class OsUtils {

    /**
     * Creates a directory path if it does not exist.
     *
     * @param directoryPath the path of the directory to create.
     */
    public void creatDirPath(String directoryPath) {
        File directory = new File(directoryPath);

        if (!directory.exists()) {
            boolean created = directory.mkdirs();
            if (created) {
                System.out.println("Directory successfully created!");
            } else {
                System.out.println(
                    "Failed to create directory. Please check if the path is correct or if you have the necessary permissions.");
            }
        } else {
            System.out.println("Directory already exists. No need to create.");
        }
    }
}
